package com.ruoyi.web.controller.monitorTools;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.monitorTools.domain.HotTripNumber;
import com.ruoyi.monitorTools.domain.dto.TargetRegionParam;
import com.ruoyi.monitorTools.domain.vo.TargetActivityDetails;
import com.ruoyi.monitorTools.service.HotTripNumberService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description TODO
 * @Author wsl
 * @Date 2025-02-18 16:34
 * @Version 1.0
 */

@RestController
@RequestMapping("/hotSpot/detail")
@Api(tags = "统计详情")
public class HotRegionNumController extends BaseController {

    @Autowired
    private HotTripNumberService hotTripNumberService;

    @PostMapping("getRegionNum")
    @ApiOperation(value = "热点区域可视化-左侧列表")
    public TableDataInfo getRegionNum(@RequestBody TargetRegionParam targetRegionParam){
        startPage();
        List<HotTripNumber> regionNum = hotTripNumberService.getRegionNum(targetRegionParam);
        return getDataTable(regionNum);
    }

    @PostMapping("getTargetNum")
    @ApiOperation(value = "热点区域可视化-右侧列表")
    public TableDataInfo getTargetNum(@RequestBody TargetRegionParam targetRegionParam){
        startPage();
        List<HotTripNumber> targetNum = hotTripNumberService.getTargetNum(targetRegionParam);
        return getDataTable(targetNum);
    }

    @PostMapping("/getDetailByTaskId")
    @ApiOperation(value = "热点区域可视化-详情")
    public TableDataInfo getDetailByTaskId(@RequestBody TargetRegionParam targetRegionParam){
        startPage();
        List<TargetActivityDetails> targetActivityDetailsList = hotTripNumberService.getDetailByTaskId(targetRegionParam);
        return getDataTable(targetActivityDetailsList);
    }

}
